package com.twu.biblioteca;

/**
 * Created by MDH on 23/07/2014.
 */
public class UserAccountImpl implements UserAccount{
    private String name;
    private String email;
    private String phone;
    private String password;
    private String accountNumber;

    public UserAccountImpl(String userAccountNumber, String userName, String userEmail, String userPhone, String userPassword) {
        this.name = userName;
        email = userEmail;
        phone = userPhone;
        password = userPassword;
        accountNumber = userAccountNumber;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public String getEmail() {
        return email;
    }

    @Override
    public String getPhone() {
        return phone;
    }

    @Override
    public String getAccountNumber() {
        return accountNumber;
    }

    @Override
    public boolean isPasswordTheSame(String userPassword) {
        if(password.equals(userPassword)){
            return true;
        }
        return false;
    }

    @Override
    public boolean isUserAccountFormatCorrect(String userAccountNumber) {
        return userAccountNumber.matches("\\d\\d\\d-\\d\\d\\d\\d");

    }
}
